﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Data.Common;
using System.Data.Entity;
using System.Data.Entity.ModelConfiguration;
using System.Data.Entity.Infrastructure;
using DLM.Domain.Model;
using DLM.Infrastructure;

namespace DLM.Data.EF.CodeFirst.Mapping
{
    public class PartyMap:EntityTypeConfiguration<Party>
    {
        public PartyMap()
        {
            this.HasKey(t => t.PartyID);
            this.ToTable("Party");
            this.Property(t => t.PartyID).HasColumnName("PartyID");
            this.Property(t => t.Status).HasColumnName("Status");
            this.Property(t => t.PartyType).HasColumnName("PartyType");
            this.Property(t => t.Subject).HasColumnName("Subject").IsRequired().HasMaxLength(30);
            this.Property(t => t.PhotoUrl).HasColumnName("PhotoUrl").HasMaxLength(20);
            this.Property(t => t.Modality).HasColumnName("Modality").HasMaxLength(20);
            this.Property(t => t.PartyDate).HasColumnName("PartyDate");
            this.Property(t => t.Location).HasColumnName("Location").HasMaxLength(100);
            this.Property(t => t.Address).HasColumnName("Address").HasMaxLength(150);
            this.Property(t => t.MemberCount).HasColumnName("MemberCount");
            this.Property(t => t.CreateDate).HasColumnName("CreateDate");
            this.Property(t => t.EndDate).HasColumnName("EndDate");
            this.Property(t => t.Area).HasColumnName("Area").HasMaxLength(50);
            this.Property(t => t.IsSuccess).HasColumnName("IsSuccess");
            this.Property(t => t.Content).HasColumnName("Content");
            this.Property(t => t.Expense).HasColumnName("Expense");
            this.Property(t => t.PaymentType).HasColumnName("PaymentType");

        }
    }
}
